﻿Public Class Empresa

    Private Sub EmpresaBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EmpresaBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.EmpresaBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DbcoverDataSet1)

    End Sub

    Private Sub Empresa_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: esta línea de código carga datos en la tabla 'DbcoverDataSet1.Empresa' Puede moverla o quitarla según sea necesario.

        Me.EmpresaTableAdapter.Fill(Me.DbcoverDataSet1.Empresa)
        If DbcoverDataSet1.Empresa.Count = 0 Then
            Me.EmpresaBindingNavigator.BindingSource.AddNew()

        Else

        End If
    End Sub


    Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click

    End Sub

    Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click
        Me.EmpresaBindingSource.CancelEdit()
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Call Me.EmpresaBindingNavigatorSaveItem_Click("", e)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Call Me.BindingNavigatorDeleteItem_Click("", e)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.OpenFileDialog1.Filter = "Imágenes JPG(*.jpg)|*.jpg|Imágenes PNG(*.png)|*.png"
        If Me.OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Me.LogoPictureBox.Image = Image.FromFile(Me.OpenFileDialog1.FileName)
        End If

    End Sub
End Class